package program;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import program.controller.MemoryController;
import program.controller.ProcessController;

import java.io.IOException;

/**
 * @program: OSAlgorithms
 * @description: 主函数
 * @author:
 * @create: 2021-10-21 12:40
 **/
public class Main extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws IOException {
        //Parent root = (AnchorPane) FXMLLoader.load(getClass()
        //        .getResource("/process.fxml"));
        //
        //primaryStage.setTitle("Process");
        //primaryStage.setScene(new Scene(root));
        //
        //ProcessController.processController.mainMethod();

        Parent root = (AnchorPane) FXMLLoader.load(getClass()
                .getResource("/memory.fxml"));

        primaryStage.setTitle("Memory");
        primaryStage.setScene(new Scene(root));

        //MemoryController.memoryController.FirstFitAllocate();
        //MemoryController.memoryController.BestFitAllocate();
        MemoryController.memoryController.WorstFitAllocate();
        primaryStage.show();
    }

}
